package com.jiyun.controller;


import com.jiyun.pojo.Duty;
import com.jiyun.pojo.Employee;
import com.jiyun.pojo.Sector;
import com.jiyun.serviceImpl.EmployeeServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
public class ProviderController {
    @Autowired
    EmployeeServiceImpl employeeService;

    @RequestMapping("show")
    public List<Employee> show(){
      return employeeService.show();
    }

    @RequestMapping("del/{id}")
    public void del(@PathVariable Integer id){
       employeeService.del(id);
    }

    @RequestMapping("findzhi")
    public List<Duty> findzhi(){
        return employeeService.findzhi();
    }

    @RequestMapping("findbu")
    public List<Sector>findbu(){
        return  employeeService.findbu();
    }
    @RequestMapping("add")
    public void add(@RequestBody Employee employee){
        employeeService.add(employee);
    }

    @RequestMapping("update")
    public void update(@RequestBody Employee employee){
        employeeService.update(employee);
    }


    @RequestMapping("findPagesec")
    public List<Duty> findPagesec(){
        return employeeService.findPagesec();
    }

    @RequestMapping("delsec/{id}")
    public void delsec(@PathVariable Integer id){
        employeeService.delsec(id);
    }
    @RequestMapping("addsec")
    public void addsec(@RequestBody Sector sector){
        employeeService.addsec(sector);
    }

    @RequestMapping("updatesec")
    public void updatesec(@RequestBody Duty duty){
        employeeService.updatesec(duty);
    }
    @RequestMapping("zhiwuadd")
    public void zhiwuadd(@RequestBody Duty duty){
        employeeService.zhiwuadd(duty);
    }


}
